Optimal. Leaf size=244 \[ -\frac{\sqrt{2} c \left (\frac{b}{\sqrt{b^2-4 a c}}+1\right ) \tan ^{-1}\left (\frac{\tan \left (\frac{x}{2}\right ) \left (b-\sqrt{b^2-4 a c}\right )+2 c}{\sqrt{2} \sqrt{-b \sqrt{b^2-4 a c}-2 c (a+c)+b^2}}\right )}{a \sqrt{-b \sqrt{b^2-4 a c}-2 c (a+c)+b^2}}-\frac{\sqrt{2} c \left (1-\frac{b}{\sqrt{b^2-4 a c}}\right ) \tan ^{-1}\left (\frac{\tan \left (\frac{x}{2}\right ) \left (\sqrt{b^2-4 a c}+b\right )+2 c}{\sqrt{2} \sqrt{b \sqrt{b^2-4 a c}-2 c (a+c)+b^2}}\right )}{a \sqrt{b \sqrt{b^2-4 a c}-2 c (a+c)+b^2}}-\frac{\tanh ^{-1}(\cos (x))}{a} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.762139, antiderivative size = 244, normalized size of antiderivative = 1., number of steps used = 10, number of rules used = 6, integrand size = 17, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.353, Rules used = {3256, 3770, 3292, 2660, 618, 204} \[ -\frac{\sqrt{2} c \left (\frac{b}{\sqrt{b^2-4 a c}}+1\right ) \tan ^{-1}\left (\frac{\tan \left (\frac{x}{2}\right ) \left (b-\sqrt{b^2-4 a c}\right )+2 c}{\sqrt{2} \sqrt{-b \sqrt{b^2-4 a c}-2 c (a+c)+b^2}}\right )}{a \sqrt{-b \sqrt{b^2-4 a c}-2 c (a+c)+b^2}}-\frac{\sqrt{2} c \left (1-\frac{b}{\sqrt{b^2-4 a c}}\right ) \tan ^{-1}\left (\frac{\tan \left (\frac{x}{2}\right ) \left (\sqrt{b^2-4 a c}+b\right )+2 c}{\sqrt{2} \sqrt{b \sqrt{b^2-4 a c}-2 c (a+c)+b^2}}\right )}{a \sqrt{b \sqrt{b^2-4 a c}-2 c (a+c)+b^2}}-\frac{\tanh ^{-1}(\cos (x))}{a} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3256
Rule 3770
Rule 3292
Rule 2660
Rule 618
Rule 204
Rubi steps
\begin{align*} \int \frac{\csc (x)}{a+b \sin (x)+c \sin ^2(x)} \, dx &=\int \left (\frac{\csc (x)}{a}+\frac{-b-c \sin (x)}{a \left (a+b \sin (x)+c \sin ^2(x)\right )}\right ) \, dx\\ &=\frac{\int \csc (x) \, dx}{a}+\frac{\int \frac{-b-c \sin (x)}{a+b \sin (x)+c \sin ^2(x)} \, dx}{a}\\ &=-\frac{\tanh ^{-1}(\cos (x))}{a}-\frac{\left (c \left (1-\frac{b}{\sqrt{b^2-4 a c}}\right )\right ) \int \frac{1}{b+\sqrt{b^2-4 a c}+2 c \sin (x)} \, dx}{a}-\frac{\left (c \left (1+\frac{b}{\sqrt{b^2-4 a c}}\right )\right ) \int \frac{1}{b-\sqrt{b^2-4 a c}+2 c \sin (x)} \, dx}{a}\\ &=-\frac{\tanh ^{-1}(\cos (x))}{a}-\frac{\left (2 c \left (1-\frac{b}{\sqrt{b^2-4 a c}}\right )\right ) \operatorname{Subst}\left (\int \frac{1}{b+\sqrt{b^2-4 a c}+4 c x+\left (b+\sqrt{b^2-4 a c}\right ) x^2} \, dx,x,\tan \left (\frac{x}{2}\right )\right )}{a}-\frac{\left (2 c \left (1+\frac{b}{\sqrt{b^2-4 a c}}\right )\right ) \operatorname{Subst}\left (\int \frac{1}{b-\sqrt{b^2-4 a c}+4 c x+\left (b-\sqrt{b^2-4 a c}\right ) x^2} \, dx,x,\tan \left (\frac{x}{2}\right )\right )}{a}\\ &=-\frac{\tanh ^{-1}(\cos (x))}{a}+\frac{\left (4 c \left (1-\frac{b}{\sqrt{b^2-4 a c}}\right )\right ) \operatorname{Subst}\left (\int \frac{1}{4 \left (4 c^2-\left (b+\sqrt{b^2-4 a c}\right )^2\right )-x^2} \, dx,x,4 c+2 \left (b+\sqrt{b^2-4 a c}\right ) \tan \left (\frac{x}{2}\right )\right )}{a}+\frac{\left (4 c \left (1+\frac{b}{\sqrt{b^2-4 a c}}\right )\right ) \operatorname{Subst}\left (\int \frac{1}{-8 \left (b^2-2 c (a+c)-b \sqrt{b^2-4 a c}\right )-x^2} \, dx,x,4 c+2 \left (b-\sqrt{b^2-4 a c}\right ) \tan \left (\frac{x}{2}\right )\right )}{a}\\ &=-\frac{\sqrt{2} c \left (1+\frac{b}{\sqrt{b^2-4 a c}}\right ) \tan ^{-1}\left (\frac{2 c+\left (b-\sqrt{b^2-4 a c}\right ) \tan \left (\frac{x}{2}\right )}{\sqrt{2} \sqrt{b^2-2 c (a+c)-b \sqrt{b^2-4 a c}}}\right )}{a \sqrt{b^2-2 c (a+c)-b \sqrt{b^2-4 a c}}}-\frac{\sqrt{2} c \left (1-\frac{b}{\sqrt{b^2-4 a c}}\right ) \tan ^{-1}\left (\frac{2 c+\left (b+\sqrt{b^2-4 a c}\right ) \tan \left (\frac{x}{2}\right )}{\sqrt{2} \sqrt{b^2-2 c (a+c)+b \sqrt{b^2-4 a c}}}\right )}{a \sqrt{b^2-2 c (a+c)+b \sqrt{b^2-4 a c}}}-\frac{\tanh ^{-1}(\cos (x))}{a}\\ \end{align*}
Mathematica [C] time = 1.31748, size = 306, normalized size = 1.25 \[ -\frac{\frac{c \left (\sqrt{4 a c-b^2}-i b\right ) \tan ^{-1}\left (\frac{2 c+\tan \left (\frac{x}{2}\right ) \left (b-i \sqrt{4 a c-b^2}\right )}{\sqrt{2} \sqrt{-i b \sqrt{4 a c-b^2}-2 c (a+c)+b^2}}\right )}{\sqrt{2 a c-\frac{b^2}{2}} \sqrt{-i b \sqrt{4 a c-b^2}-2 c (a+c)+b^2}}+\frac{c \left (\sqrt{4 a c-b^2}+i b\right ) \tan ^{-1}\left (\frac{2 c+\tan \left (\frac{x}{2}\right ) \left (b+i \sqrt{4 a c-b^2}\right )}{\sqrt{2} \sqrt{i b \sqrt{4 a c-b^2}-2 c (a+c)+b^2}}\right )}{\sqrt{2 a c-\frac{b^2}{2}} \sqrt{i b \sqrt{4 a c-b^2}-2 c (a+c)+b^2}}-\log \left (\sin \left (\frac{x}{2}\right )\right )+\log \left (\cos \left (\frac{x}{2}\right )\right )}{a} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] time = 0.17, size = 849, normalized size = 3.5 \begin{align*} \text{result too large to display} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\csc{\left (x \right )}}{a + b \sin{\left (x \right )} + c \sin ^{2}{\left (x \right )}}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\csc \left (x\right )}{c \sin \left (x\right )^{2} + b \sin \left (x\right ) + a}\,{d x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]